#include"myfile.h"

#define myfile "log.txt"

int main()
{
    MY_FILE* mf = my_fopen(myfile,"w+");
    char* ptr = "hello myFILE";
    char str[1024];
    int i = 5;
    while(i)
    {
        snprintf(str,1024,"%s :%d\n",ptr,i--);
        my_fwrite(str,strlen(str),1,mf);
    }
    int n = read(mf->fd,str,1024);
    str[n] = '\0';
    printf("%s",str);
    my_fclose(mf);
    return 0;
}